<%@page import="lib_model.Orther.ReturnObj"%>
<%@page import="java.util.ArrayList"%>
<%@page import="lib_model.Factories.Factory"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<jsp:include page="../templates/Admin.jsp"></jsp:include>
Manager Factories
<jsp:include page="../templates/Title.jsp"></jsp:include>
<script type="text/javascript">
	$(document).ready(function() {
		$("#createfac").hide();
		$("#btcreate").click(function() {
			$("#createfac").fadeIn();
		});
	});
</script>
<jsp:include page="../templates/StyleAd.jsp"></jsp:include>
<div class="body-center w960">
<h2 class="title-show">Factories</h2>
<table class="tb">

	<thead>
		<tr>
			<th align="left" width="20%">Name</th>
			<th align="left" width="20%">Location</th>
			<th align="left" width="20%">Date Create</th>
			<th align="left" width="5%">Status</th>
		</tr>

	</thead>
	<%
		Factory facs = new Factory();
		ReturnObj rs = facs.Select();
		ArrayList<Factory> arr = (ArrayList<Factory>) rs.ObjResult;
	%>
	<tbody>
		<%
			for (Factory fac : arr) {
		%>
		<tr>
			<td><b><%=fac.name%></b></td>
			<td><%=fac.location%></td>
			<td><%=fac.date_create%></td>
			<%
				if (fac.status == 1) {
			%>
			<td><img src="../contents/icon/svn_normal.png" /></td>
			<%
				} else {
			%>
			<td><img src="../contents/icon/svn_modified.png" /></td>
			<%
				}
			%>
		</tr>
		<%
			}
		%>
	</tbody>

</table>
<input type="button" id="btcreate" value="Create Factories" /> <%
 	if (request.getAttribute("Mes") != null) {
 %> <br /><%=request.getAttribute("Mes")%> <%
 	}
 %>
<form action="../factories/AddFactories" method="post">
<table class="tb" style="width: 300px;" id="createfac">
	<thead>
		<tr>
			<th align="left" width="20%"></th>
			<th align="left" width="20%"></th>
		</tr>
		<tr>
			<td>Name Factories</td>
			<td><input type="text" name="txtName"></td>
		</tr>
		<tr>
			<td>Description</td>
			<td><input type="text" name="txtDes"></td>
		</tr>
		<tr>
			<td>Localtion</td>
			<td><input type="text" name="txtLoc"></td>
		</tr>
		<tr>
			<td>Status</td>
			<td><select name="txtSta">
				<Option value="1">Show</Option>
				<Option value="0">Hide</Option>
			</select></td>
		</tr>
		<tr align="center">
			<td colspan="2"><input type="submit" value="Add" width="150"></td>
		</tr>
	</thead>
</table>
</form>
</div>
<jsp:include page="../templates/Footer.jsp"></jsp:include>